import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:jump_scape/js_ui/js_widget/js_text_ghosting_view.dart';

import '../js_widget/js_style.dart';

jsShowLoadingDialog(BuildContext context) {
  showDialog(
    context: context,
    barrierDismissible: false,
    useSafeArea: false,
    barrierColor: Colors.black.withOpacity(0.55),
    builder: ((context) {
      return Column(
        mainAxisAlignment: MainAxisAlignment.center,
        children: [
          Dialog(
            alignment: Alignment.center,
            insetPadding: EdgeInsets.zero,
            backgroundColor: Colors.transparent,
            child: Container(
              width: 315.r,
              padding: EdgeInsets.symmetric(horizontal: 28.r),
              alignment: Alignment.topCenter,
              decoration: jsShapeRound(radius: 18.r, color: Colors.white, borderColor: Colors.black, borderWidth: 1.r),
              child: Column(
                mainAxisSize: MainAxisSize.max,
                mainAxisAlignment: MainAxisAlignment.center,
                crossAxisAlignment: CrossAxisAlignment.center,
                children: [
                  SizedBox(height: 30.r),
                  const CircularProgressIndicator(color: Color(0xFFFFB5DD)),
                  SizedBox(height: 20.r),
                  JsTextGhostingView('Loading...', fontSize: 28.r),
                  SizedBox(height: 30.r),
                ],
              ),
            ),
          ),
        ],
      );
    }),
  );
}
